﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<fmt:setBundle basename="ApplicationMessage" />
<fmt:setLocale value="zh_CN" />

<!DOCTYPE html>
<html lang="zh-CN">
<head>

  <%@ include file="/WEB-INF/include/meta.jsp"%>
  <%@ include file="/WEB-INF/include/css.jsp"%>
  
</head>

<body>

  <%@ include file="/WEB-INF/include/header.jsp"%>
  <%@ include file="/WEB-INF/include/submenu.jsp"%>

  <div class="container-fluid umu-container has-umu-sidemenu">
    <div class="umu-breadcrumb">
      <div class="breadcrumb">学习项目列表</div>
    </div>
    <div class="panel-default beast-panel beast-panel-layout">

      <div class="panel-body">

        <div class="col-xs-12 beast-panel-layout-right">

    		<div class="ms-content-layout">
		      <div class="ms-operation-bar no-margin no-bottom-border clearfix">
		        <div class="ms-operation-group pull-right">
					<a href="${ctx.host}/project-results/search" data-toggle="modal" data-target="#search" class="btn btn-shadow-success btn-shadow umu-btn">
					  <i class="glyphicon glyphicon-search"></i>&nbsp;&nbsp;过滤查询
					</a>
		        </div>
		      </div>
		      <br />
		    
		      <table class="table table-hover umu-table tab-pane table-striped">
		        <thead>
		          <tr>
					<th>编号</th>
					<th>项目分类</th>
					<th>项目名称</th>
					<th>总期数</th>
					<th>项目负责人</th>
					<th>事业部</th>
					<th>起始时间</th>
					
					<th>课后评估</th>
					<th>成绩录入</th>
					<th class="text-center">操作</th>
		          </tr>
		        </thead>
		        <tbody>
					<c:forEach items="${projects}" var="project">
			            <tr>
			              <td>${project.code}</td>
			              <td>${project.firstCategory.name}<br />${project.secondCategory.name}</td>
			              <td>
			                <div style="cursor: pointer; margin: 0 auto; text-align: center; width: 150px; white-space: nowrap; text-overflow: ellipsis; overflow:hidden;" data-toggle="tooltip" title="${project.name}">${project.name}</div>
			              </td>
			              <td>${project.phaseCount}</td>
			              <td>
			                <c:set var="projectLead" value="${persist.idmUser(project.projectLead)}"></c:set>
							<span style="cursor: pointer;" data-toggle="tooltip" title="${projectLead.usercn}（${projectLead.orgDepart}）">${projectLead.usercn}</span>
			              </td>
			              <td>${project.department.name}</td>
			              <td><fmt:formatDate value="${project.beginDate}" pattern="yyyy-MM-dd"/><br /><fmt:formatDate value="${project.endDate}" pattern="yyyy-MM-dd"/></td>
			              <td>${surveyStatusMap[project.id]}</td>
			              <td>${resultStatusMap[project.id]}</td>
			              <td class="text-center">
			              	<%-- <a href="${ctx.host}/project-results/${project.id}/trainee-score-upload" data-target="#upload" data-toggle="model">成绩导入</a>&nbsp;&nbsp; --%>
							<a href="${ctx.host}/project-results/${project.id}" data-target="#view" data-toggle="model">详情</a>&nbsp;&nbsp;
							<a href="${ctx.host}/project-results/${project.id}/trainee-score-export" data-target="#view" data-toggle="">成绩导出</a>
			              </td>
			            </tr>
			          </c:forEach>		        
		        </tbody>
		        <tfoot>
		          <tr>
		            <td colspan="12" class="no-vertical-padding">
		              <div class="pull-left">
		                <jsp:include page="/WEB-INF/include/page.jsp">
		                  <jsp:param name="url" value="${ctx.host}/project-results" />
		                  <jsp:param name="queryString" value="${queryString}" />
		                </jsp:include>
		              </div>
		            </td>
		          </tr>
		        </tfoot>
		      </table>		        

		    </div>           
        </div>

      </div>

    </div>

  </div>

  <%@ include file="/WEB-INF/include/footer.jsp"%>
  <%@ include file="/WEB-INF/include/script.jsp"%>
<d:resource root="${ctx.resource}/build" type="script" src="js/page/project/project-result-list.js" />
<script type="text/javascript">
        require([ 'page/project/project-result-list' ], function(page) {
            page.init({
            	subCategory: JSON.parse('${persist.subCategory}')
            });
        })
    </script>
</body>
</html>